package com.oyesgo.statistics.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
/**
 * @FileName FileUtil.java
 * @Description: 
 * @author rose
 * @version 1.0
 * <p>Company: OYESGO</p>
 * <p>Copyright: Copyright (c) 2010</p>
 */
public class FileUtil{
	
	public static void readFile(String filePath){
		File file = new File(filePath);
		FileInputStream fis = null;
		InputStreamReader isr = null;
		LineNumberReader lnr = null;
		try {
			fis = new FileInputStream(file);
			isr = new InputStreamReader(fis);
			lnr = new LineNumberReader(isr);//�������ж�ȡ�׽���
			String str = null;
			int i = 0;
			try {
				while((str = lnr.readLine()) != null){
					i++;
//					System.out.println(str);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			System.out.println(i);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}finally{
			try {
				fis.close();
				fis = null;
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
}
